package com.fire.control.system.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fire.control.system.entity.Device;
import com.fire.control.system.entity.DeviceGroup;

public class DeviceGroupDTO implements Serializable {

	private static final long serialVersionUID = 1L;
	// 设备组id
	private String groupId;
	// 设备组名称
	private String groupName;
	// 支持设备数量
	private String deviceCounts;
	// 所属组
	private String belongsGroup;
	// 设备组状态
	private Boolean status;
	// 创建时间
	private Date createTime;
	// 描述
	private String description;
	// 企业名称
	private String companyName;
	// 企业id
	private String companyId;
	
	
	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public String getDeviceCounts() {
		return deviceCounts;
	}

	public void setDeviceCounts(String deviceCounts) {
		this.deviceCounts = deviceCounts;
	}

	public String getBelongsGroup() {
		return belongsGroup;
	}

	public void setBelongsGroup(String belongsGroup) {
		this.belongsGroup = belongsGroup;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	
	public void setDeviceGroup(DeviceGroup deviceGroup) {
		this.groupId = deviceGroup.getId();
		//this.belongsGroup = deviceGroup.getBelongsGroup(); //此项暂无
		if(deviceGroup.getCompany() != null) {
			this.companyName = deviceGroup.getCompany().getCompanyName();
			this.companyId = deviceGroup.getCompany().getId();
		}
		this.createTime = deviceGroup.getCreateTime();
		this.description = deviceGroup.getGroupDesc();
		List <Device> list = (List<Device>) deviceGroup.getDevices();
		if(null != list && list.isEmpty() == false) {
			this.deviceCounts = String.valueOf(list.size());
		}
		this.status = deviceGroup.getStatus();
		this.groupName = deviceGroup.getGroupName();
	}
	
}
